<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

// Route::get('/', function () {
//     return view('index');
// });

//路由组
Route::group(['middleware'=>'adminlogin'],function(){
	//隐式控制器 
	Route::Controller('/admin/','AdminController');

	//后台用户的控制器
	Route::Controller('/admin/user','UserController');

	//后台商品分类
	Route::Controller('/admin/cate','CateController');

	//后商品管理
	Route::Controller('/admin/goods','GoodsController');
});

//后台登录页面
Route::Controller('/admin/login','LoginController');


//前台注册页面 
Route::get('/account','LoginController@account');
//执行注册
Route::post('/doaccount','LoginController@doaccount');

//前台登录
Route::get('/hologin','LoginController@hologin');

//前台退出
Route::get('/homelogout','HomelogoutController@homelogout');

//发送邮箱
Route::get('/seedmail','LoginController@seedmail');
//邮件激活
Route::get('/jihuo','LoginController@jihuo');

//前台详情页
Route::get('/product/{id}','HomeLoginController@product');

//前台分类商品列表页面
Route::get('/category/{id}','HomeLoginController@category');

//前台加入购物车
Route::post('/cart/insert','CartController@insert');

//购物车列表
Route::get('/cart/index','CartController@index');

//删除购物的商品
Route::get('/cart/delete','CartController@delete');

//清空购物车
Route::get('/cart/clear','CartController@clear');

//前台个人中心
// Route::get('/homeuser','HomeuserController@homeuser');
//个人中心添加收货地址
// Route::get('/homeuser/insert','HomeuserController@insert');
//个人中心控制器
Route::Controller('/homeuser','HomeuserController');





